
<?php
defined('_JEXEC') or die('Restricted access');
date_default_timezone_set('Asia/Ho_Chi_Minh');
JTable::addIncludePath ( JPATH_COMPONENT. DS . 'tables' );
$user = JFactory::getUser();
$app = &JFactory::getApplication();
if($user->id == '')
{
    $app->redirect('index.php?option=com_login','Bạn chưa đăng nhập');
                return;
}
if($user->get('isRoot')!=1){
		$app->redirect('index.php','Bạn không phải admin.');
                return;
}

            $view = JRequest::getCmd( 'view', 'dashboard' );

            switch ($view) {

                    case 'dashboard':

                            $controllerName = 'dashboard';

                    break;

                    case 'items':

                            $controllerName = 'items';

                    break;

                    default:

                            $controllerName = $view;

            }
            
            require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php' );

            $controller = new admin_employeeController();

            $controller->execute( JRequest::getCmd('task') );

            $controller->redirect();
            
?>